package com.itxiuyixiu.homework.entity.dto;

import com.itxiuyixiu.homework.entity.enums.Sex;
import com.itxiuyixiu.homework.entity.model.Academy;
import com.itxiuyixiu.homework.entity.model.Teacher;

/**
 * @author 黄磊
 * @date 2020/3/5
 */
public class TeacherDto implements Cloneable{

    /**
     * 老师Id
     */
    private Integer id;

    /**
     * 教师姓名
     */
    private String teacherName;

    /**
     * 教师信息
     */
    private String teacherMessage;

    /**
     * 性别
     */
    private Sex sex;

    /**
     * 身份证
     */
    private String identifyCard;

    /**
     * 联系方式
     */
    private String contract;

    /**
     * 学院id
     */
    Integer academyId;

    public static Teacher parseTeacher(TeacherDto dto, Academy academy) {
        Teacher teacher = new Teacher();
        teacher.setTeacherName(dto.getTeacherName());
        teacher.setTeacherMessage(dto.getTeacherMessage());
        teacher.setSex(dto.getSex());
        teacher.setIdentifyCard(dto.getIdentifyCard());
        teacher.setContract(dto.getContract());
        teacher.setAcademy(academy);
        return teacher;
    }


    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getTeacherMessage() {
        return teacherMessage;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setTeacherMessage(String teacherMessage) {
        this.teacherMessage = teacherMessage;
    }

    public Sex getSex() {
        return sex;
    }

    public void setSex(Sex sex) {
        this.sex = sex;
    }

    public String getIdentifyCard() {
        return identifyCard;
    }

    public void setIdentifyCard(String identifyCard) {
        this.identifyCard = identifyCard;
    }

    public String getContract() {
        return contract;
    }

    public void setContract(String contract) {
        this.contract = contract;
    }

    public Integer getAcademyId() {
        return academyId;
    }

    public void setAcademyId(int academyId) {
        this.academyId = academyId;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public void setAcademyId(Integer academyId) {
        this.academyId = academyId;
    }

    @Override
    public String toString() {
        return "TeacherDto{" +
                "id=" + id +
                ", teacherName='" + teacherName + '\'' +
                ", teacherMessage='" + teacherMessage + '\'' +
                ", sex=" + sex +
                ", identifyCard='" + identifyCard + '\'' +
                ", contract='" + contract + '\'' +
                ", academyId=" + academyId +
                '}';
    }
}
